<?php
class Applicant extends CI_Model {

   /* var $order_day   = '';
    var $arrival_day = '';
    var $email = '';
    var $number_of_applicant = '';
    var $status = '';*/

	/*function get_orders($start,$limit)
    {
	    $query = $this->db->query("SELECT * FROM orders LIMIT $start,$limit");
		return $query->result_array();
        
    }
	function get_total()
    {
	    $query = $this->db->query('SELECT count(*) as total FROM orders');
		$row = $query->row_array();
        return $row['total'];
    }*/
    function insert_applicant($data)
    {
        $this->filterData($data);
        $this->db->insert('applicant', $data);
    }

    /*function update_order($data,$id)
    {
		$this->filterData($data);
        $this->db->update('orders', $data, array('id' => $id));
    }
    function delete_order($id){
    	$this->db->delete('orders', array('id' => $id)); 
    }*/
	protected function filterData(&$data){
		foreach($data as $key=>$row){
			if (!$this->db->field_exists($key, 'applicant'))
			{
				unset($data[$key]);
			} 
		}
    }
}